package com.qf.dao;

import com.qf.pojo.entity.GoodsClassify;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


public interface GoodsClassiftRepository extends JpaRepository<GoodsClassify,Integer> {

    @Query(value ="SELECT gc.id as id, gc.food_classify_name as foodClassifyName FROM goods_classify gc, " +
            "store_goods_classify sgc WHERE gc.id=sgc.goods_classify_id AND sgc.store_id=?1" ,nativeQuery = true)
    List<GoodsClassify> finfByStoreId(int storeId);

//    @Query(value = "update goods_classify set food_classify_name=#{foodClassifyName} where id=#{id}",nativeQuery = true)
//    @Modifying
//    @Transactional
//    void updateGC(GoodsClassify goodsClassify);
}
